<!DOCTYPE html>
<html>
<head>
<title>投标记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">

<script type="text/javascript">
  var dataGrid;
  var winWidth =  750;
  var winHeight = 450;

  $(function() {
    var editIndex = undefined;
    dataGrid = $('#dataGrid').datagrid({
      url : 'tenderList.html',
      fit : true,
      fitColumns : true,
      border : false,
      pagination : true,
      idField : 'id',
      pageSize : 20,
      pageNums :1,
      pageList : [ 20, 30, 40, 50 ],
      sortName : 'id',
      sortOrder : 'asc',
      checkOnSelect : false,
      selectOnCheck : false,
      nowrap : false,
      singleSelect:true,
      columns : [ [
	      { field: 'id', title: '编号', width: 50},
	      { field: 'userName', title: '用户名', width: 80},
	      { field: 'realName', title: '真实姓名', width: 100},
	      { field: 'borrowName', title: '标名', width: 150},
	      { field: 'period', title: '期数', width: 40},
	      { field: 'money', title: '投资金额(元)', width: 80},
	      { field: 'interest', title: '利息(元)', width: 60},
	      { field: 'repaymentAccount', title: '待收总额(元)', width: 80},
	      { field: 'addTime', title: '投资时间', width: 130, sortable:false,formatter: function(value,row,index){
				return getLocalTime(value,4);
	  	  	}  
	      },
	      { field: 'statusString', title: '投资状态', width: 60}
      ]],
      toolbar : '#toolbar',
      onRowContextMenu : function(e, rowIndex, rowData) {
        e.preventDefault();
        $(this).datagrid('unselectAll').datagrid('uncheckAll');
        $(this).datagrid('selectRow', rowIndex);
        $('#menu').menu('show', {
          left : e.pageX,
          top : e.pageY
        });
      }
    }); 
  });
    
   function exportExcel(){
    var url = "/modules/loan/tender/exportExcelTender.html";
    var category=$("#category").val();
    var userName = $("#userName").val();
    var realName = $("#realName").val();
    var status = $("#status").val();
    var startTime = $("#startTime").val();
    var endTime = $("#endTime").val();
     var borrowName = $("#borrowName").val();
    var sou = "?userName=" + userName + "&realName=" + realName + "&status=" + status + "&startTime=" + startTime + "&endTime=" + endTime+"&category="+category+"&borrowName="+borrowName;
    window.location.href = url + sou;
  }
</script>

</head>
<body style="padding:0 20px;" >
  <div class="easyui-layout" data-options="fit : true,border : false">
    <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
          <div class="sLeft">
              <form id="searchForm">
                <input type="text"  name="searchName" class="sInput" placeholder="输入用户名/真实姓名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
              	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
              </form>
            </div>
            <div class="sRight">
              <a id="a" onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>  
            </div>
            <form id="showAdw">
            <ul class="showAdw" style="display:none;">
              <a href="javascript:void(0);"><i class="iconfont closeWin">&#xe628;</i></a>
              <li><span>用户名</span><input type="text" name="userName" id="userName" autocomplete="off"  data-options="required:true,validType:'length[4,16]'"/></li>
              <li><span>真实姓名</span><input type="text" name="realName" id="realName" autocomplete="off"/></li>
              <li><span>标名</span><input type="text" name="borrowName" id="borrowName" autocomplete="off"/></li>
              <li><span>状态</span><select name="status" id="status" class="type">
              <option value="-1">全部</option>
              <option value="0">投资待处理</option>
              <option value="1">投资成功</option>
              <option value="2">投资失败</option>
              </select></li>
              <li><span>标类型</span><select name="category" id="category" class="type">
                <option value="99">全部</option>
                <option value="0">新手标</option>
                <option value="1">普通标</option>
                <option value="2">体验标</option>
              </select></li>
              <li><span>标种</span><select name="borrowType" id="borrowType" class="type">
                <option value="0">全部</option>
                <option value="112">趣豆标</option>
                <option value="103">趣影标</option>
              </select></li>
              <li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
              <li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
            </ul>
          </form>
    </div>
    <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
      <table id="dataGrid"></table>
    </div>
  </div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>